***** OPEN OUTPUT LOG FILE FOR APPENDIX G ANALYSES: "HARDIWRING MUTUAL COMMITTMENT" *****



*log "C:\Users\gk57526\Dropbox\Confirmation Dynamics Project (Jason Byers)\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Output\Hardwiring Committment.APPENDIX G.04-21-2023.smcl" 

log using "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Output\Hardwiring Committment.APPENDIX G.04-21-2023.smcl", replace



*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





**** APPENDIX G STATISTICAL ANALYSES: REPLICATE MANUSCRIPT MODELS -- SPLIT INTO 1ST YEAR ADMINISTRATION NOMINATED APPOINTEES [if okstartadyr==1: N = 370, 43.02% OF FULL SAMPLE] VERSUS NON-1ST YEAR ///
**** ADMINISTRATION NOMINATED APPOINTEES [if okstartadyr!=1: N = 490, 56.98% OF FULL SAMPLE] ****

use "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Data\Krause and Byers.SRD.06-03-2022.dta", replace



*** DESCRIPTIVE STATISTICS OF SPLIT PRESIDENTIAL SUBSAMPLES BY NUMBER OF TERMS]: EMPLOY IN CALCULATING MARGINAL EFFECTS FROM REGRESSION MODELS BELOW ***

sum zloyalmedian if okstartadyr==1, detail

sum zloyalmedian if okstartadyr!=1, detail




** GENERATE CENSORING VARIABLE FOR HOLDOVER APPOINTEES SERVING BETWEEN/ACROSS ADMINISTRATIONS [=1]; UNCENSRED OBSERVATIONS [=0] ** 

gen singleadmin_service=1 if holdover==0
*
replace singleadmin_service=0 if holdover==1
*
*
tab singleadmin_service


** SET FOR SURVIVAL DATA WITH A SINGLE RECORD PER APPOINTEE OBSERVATION [N = 860: UNCENSORED N = 831; CENSORED N = 29] ** 
stset okapptdur, failure(singleadmin_service)
*




*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

*
*
*
*

** ESTIMATE COX SEMIPARAMETRIC AND WEIBULL PARAMETRIC MODELS PRESENTED IN MANUSCRIPT [MODELS H1A - H4B] ** 


** NOTE COVARIATES THAT VARY TRHOUGH TIME ARE BASED ON THE STARTING DATE OF APPOINTED SERVICE [I.E., "OKSTART....""]


 **** ORIGINAL-FULL SAMPLE (N = 860); ONLY YEAR 1 NOMINEES (N = 370 -- "HA" MODELS); NON-YEAR 1 NOMINEES (N = 490) --  "HB" MODELS] ***



****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** MANUSCRIPT-BASED SURVIVAL REGRESSION ANALYSES: COX SEMIPARAMETRIC & WEIBULL PARAMETRIC MODELS ****




****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** APPENDIX G REGRESSION MODELS  ***




**** MODEL G1A: COX MODEL [OMISSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment   if okstartadyr==1,  hr vce(cluster sbagency)
*
estat ic

estimates store modelG1A
estout modelG1A, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure G1A: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1A−MG4A] × 1 Horizontal Point Estimates and 95% CIs}}. ****
*** NOTE: IQR = 1.418517 [1.049077 - (-0.36944)] ***

 

** ONE INTERQUARTILE RANGE MARGINAL EFFECT INCREASE IN APPOINTEE LOYALTY DIFFERENTIAL BETWEEN POLICY PRIORITY AGENCY VERSUS NON-POLICY PRIORITY AGENCY [FIGURE H1] **

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.418517, eform(hr)
matrix modelG1Azloyal = r(table)
mat list modelG1Azloyal
*


******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** MODEL G1B: COX MODEL [OMISSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i.okstartadyr  if okstartadyr!=1,  hr vce(cluster sbagency)
*
estat ic

estimates store modelG1B
estout modelG1B, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure G1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1B−MG4B] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQR =  0.7979161  [0.3859205 - (-0.4119956)] ***



** ONE INTERQUARTILE RANGE MARGINAL EFFECT INCREASE IN APPOINTEE LOYALTY DIFFERENTIAL BETWEEN POLICY PRIORITY AGENCY VERSUS NON-POLICY PRIORITY AGENCY [FIGURE H1] **

lincomest 1.soubinaryagency2nom#c.zloyalmedian*0.7979161, eform(hr)
matrix modelG1Bzloyal = r(table)
mat list modelG1Bzloyal
*




******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



**** MODEL G2A: COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i.sbagency reagan bush41 clinton bush43  if okstartadyr==1,  hr vce(cluster sbagency)
*
estat ic

estimates store modelG2A
estout modelG2A, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure G1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1A−MG4A] × 1 Horizontal Point Estimates and 95% CIs}}. ****
*** NOTE: IQR = 1.418517 [1.049077 - (-0.36944)] ***

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.418517, eform(hr)
matrix modelG2Azloyal = r(table)
mat list modelG2Azloyal



******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



**** MODEL G2B: COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i.okstartadyr  i.sbagency reagan bush41 clinton bush43  if okstartadyr!=1,  hr vce(cluster sbagency)
*
estat ic

estimates store modelG2B
estout modelG2B, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure G1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1B−MG4B] × 1 Horizontal Point Estimates and 95% CIs}}. ****
**** NOTE: IQR =  0.7979161  [0.3859205 - (-0.4119956)] *** ***

lincomest 1.soubinaryagency2nom#c.zloyalmedian*0.7979161, eform(hr)
matrix modelG2Bzloyal = r(table)
mat list modelG2Bzloyal




**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





**** MODEL G3A: WEIBULL MODEL [OMISSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment   if okstartadyr==1,   distribution(weibull)  hr vce(cluster sbagency)
*
estat ic

estimates store modelG3A
estout modelG3A, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure G1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1A−MG4A] × 1 Horizontal Point Estimates and 95% CIs}}. ****
*** NOTE: IQR = 1.418517 [1.049077 - (-0.36944)] ***

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.418517, eform(hr)
matrix modelG3Azloyal = r(table)
mat list modelG3Azloyal



**** COMPUTE Figure G2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1−MG4] × 1 Horizontal Point Estimates and 95% CIs}.



** Generate 'manual' interaction variable ** 
generate loyalppdiff = soubinaryagency2nom*zloyalmedian

** Re-Estimate Model G3A  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  if okstartadyr==1, distribution(weibull) hr vce(cluster sbagency)

estimate store modelG3Aa


margins, predict(median time) at(loyalppdiff=(-0.36944  1.049077))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.36944  1.049077))  contrast(atcontrast(r))
matrix modelG3Aazloyal = r(table)
mat list modelG3Aazloyal




estimates restore modelG3Aa

margins, predict(median time) at(loyalppdiff=(-0.6008357 1.862952))
margins, predict(median time) at(loyalppdiff=(-0.6008357 1.862952))  contrast(atcontrast(r))

matrix modelG3Abzloyal = r(table)
mat list modelG3Abzloyal




******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





**** MODEL G3B: WEIBULL MODEL [OMISSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr if okstartadyr!=1,   distribution(weibull)  hr vce(cluster sbagency)
*
estat ic

estimates store modelG3B
estout modelG3B, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure G1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1B−MG4B] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQR =  0.7979161  [0.3859205 - (-0.4119956)] *** 

lincomest 1.soubinaryagency2nom#c.zloyalmedian*0.7979161, eform(hr)
matrix modelG3Bzloyal = r(table)
mat list modelG3Bzloyal



**** COMPUTE Figure G2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1B−MG4B] × 1 Horizontal Point Estimates and 95% CIs}.



** Generate 'manual' interaction variable ** 
*generate loyalppdiff = soubinaryagency2nom*zloyalmedian

** Re-Estimate Model G3B  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr if okstartadyr!=1,  distribution(weibull) hr vce(cluster sbagency)

estimate store modelG3Ba


margins, predict(median time) at(loyalppdiff=(-0.4119956  0.3859205))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.4119956  0.3859205))  contrast(atcontrast(r))
matrix modelG3Bazloyal = r(table)
mat list modelG3Bazloyal




estimates restore modelG3Ba

margins, predict(median time) at(loyalppdiff=(-0.6930394 1.220186))
margins, predict(median time) at(loyalppdiff=(-0.6930394 1.220186))  contrast(atcontrast(r))

matrix modelG3Bbzloyal = r(table)
mat list modelG3Bbzloyal







******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** MODEL G4A: WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr  i.sbagency reagan bush41 clinton bush43 if okstartadyr==1, distribution(weibull) hr vce(cluster sbagency)
*
estat ic

estimates store modelG4A
estout modelG4A, cells(b(star fmt(3)) se(par fmt(3))) eform



*** COMPUTE Figure G1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1A−MG4A] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: NOTE: IQR = 1.418517 [1.049077 - (-0.36944)] 

lincomest 1.soubinaryagency2nom#c.zloyalmedian*0.8404716, eform(hr)
matrix modelG4Azloyal = r(table)
mat list modelG4Azloyal




**** COMPUTE Figure G2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1A−MG4A] × 1 Horizontal Point Estimates and 95% CIs}.

** Re-Estimate Model G4A  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment   i.sbagency reagan bush41 clinton bush43 if okstartadyr==1, distribution(weibull) hr vce(cluster sbagency)

estimates store modelG4Aa

margins, predict(median time) at(loyalppdiff=(-0.36944  1.049077))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.36944 1.049077))  contrast(atcontrast(r))

matrix modelG4Aazloyal = r(table)
mat list modelG4Aazloyal



estimates restore modelG4Aa

margins, predict(median time) at(loyalppdiff=(-0.6008357 1.862952))
margins, predict(median time) at(loyalppdiff=(-0.6008357 1.862952))  contrast(atcontrast(r))

matrix modelG4Abzloyal = r(table)
mat list modelG4Abzloyal






******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** MODEL G4B: WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr  i.sbagency reagan bush41 clinton bush43 if okstartadyr!=1, distribution(weibull) hr vce(cluster sbagency)
*
estat ic

estimates store modelG4B
estout modelG4B, cells(b(star fmt(3)) se(par fmt(3))) eform



*** COMPUTE Figure G1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1B−MG4B] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQR =  0.7979161  [0.3859205 - (-0.4119956)] *** 

lincomest 1.soubinaryagency2nom#c.zloyalmedian*0.7979161, eform(hr)
matrix modelG4Bzloyal = r(table)
mat list modelG4Bzloyal




**** COMPUTE Figure G2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [MG1B−MG4B] × 1 Horizontal Point Estimates and 95% CIs}.


** Re-Estimate Model G4B  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency reagan bush41 clinton bush43 if okstartadyr!=1, distribution(weibull) hr vce(cluster sbagency)

estimates store modelG4Ba

margins, predict(median time) at(loyalppdiff=(-0.4119956  0.3859205))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.4119956  0.3859205))  contrast(atcontrast(r))

matrix modelG4Bazloyal = r(table)
mat list modelG4Bazloyal



estimates restore modelG4Ba

margins, predict(median time) at(loyalppdiff=(-0.6930394 1.220186))
margins, predict(median time) at(loyalppdiff=(-0.6930394 1.220186))  contrast(atcontrast(r))

matrix modelG4Bbzloyal = r(table)
mat list modelG4Bbzloyal








***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*Figure G1

matrix pointmodel = modelG1Azloyal[1,1], modelG1Bzloyal[1,1], modelG2Azloyal[1,1], modelG2Bzloyal[1,1], modelG3Azloyal[1,1], modelG3Bzloyal[1,1], modelG4Azloyal[1,1], modelG4Bzloyal[1,1]


*
matrix cimodel = (modelG1Azloyal[5,1], modelG1Bzloyal[5,1], modelG2Azloyal[5,1], modelG2Bzloyal[5,1], modelG3Azloyal[5,1], modelG3Bzloyal[5,1], modelG4Azloyal[5,1], modelG4Bzloyal[5,1] \ modelG1Azloyal[6,1], modelG1Bzloyal[6,1], modelG2Azloyal[6,1], modelG2Bzloyal[6,1], modelG3Azloyal[6,1], modelG3Bzloyal[6,1], modelG4Azloyal[6,1], modelG4Bzloyal[6,1])

coefplot (matrix(pointmodel), ci((cimodel))), grid(none) xline(1, lcolor(red%40) lpattern(dash)) xtitle("Hazard Ratio", size(small) margin(t=2)) ylabel(1 "Model G1A"  2 "Model G1B"  3 "Model G2A" 4 "Model G2B" 5 "Model G3A" 6 "Model G3B" 7 "Model G4A" 8 "Model G4B", labsize(small) noticks) mlabel format(%9.3f) mlabposition(12) mlabsize(vsmall) xlabel(0(1)2, angle(0) labsize(small) format(%9.1f)) msymbol(o) mcolor(black) msize(small) title("FIGURE G1", size(small)) ciopts(lcolor(black)) subtitle("Marginal Differential Effect of Presidential Loyalty on Appointee Tenure Hazard" "[Policy Priority Agencies versus Non-Policy Priority Agencies]", size(small)) legend(order(17  18) lab(17 "GA Models Denote Appointees Nominated" "During the First Year of an Administration") lab(18 "GB Models Denote Appointees Not Nominated" "During the First Year of an Administration") rows(2) size(small))

graph save "Graph" "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Graphics\FigureG1.gph", replace



***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


*Figure G2

matrix pointmodelG1 = modelG3Aazloyal[1,1], modelG3Abzloyal[1,1], modelG3Bazloyal[1,1], modelG3Bbzloyal[1,1], modelG4Aazloyal[1,1], modelG4Abzloyal[1,1], modelG4Bazloyal[1,1], modelG4Bbzloyal[1,1]

*
matrix cimodel1 = (modelG3Aazloyal[5,1], modelG3Abzloyal[5,1], modelG3Bazloyal[5,1], modelG3Bbzloyal[5,1], modelG4Aazloyal[5,1], modelG4Abzloyal[5,1], modelG4Bazloyal[5,1], modelG4Bbzloyal[5,1] \ modelG3Aazloyal[6,1], modelG3Abzloyal[6,1], modelG3Bazloyal[6,1], modelG3Bbzloyal[6,1], modelG4Aazloyal[6,1], modelG4Abzloyal[6,1], modelG4Bazloyal[6,1], modelG4Bbzloyal[6,1])

coefplot (matrix(pointmodelG1), ci((cimodel1))), grid(none) xtitle("Predicted Number of Days", size(small) margin(t=2)) ylabel(1 `" "Model G3A" "Interquartile Change" "' 2 `" "Model G3A" "Interdecile Change" "' 3 `" "Model G3B" "Interquartile Change" "' 4 `" "Model G3B" "Interdecile Change" "' 5 `" "Model G4A" "Interquartile Change" "' 6 `" "Model G4A" "Interdecile Change" "' 7 `" "Model G4B" "Interquartile Change" "' 8 `" "Model G4B" "Interdecile Change" "', labsize(small) noticks) mlabel format(%9.0f) mlabposition(12) mlabsize(vsmall) xlabel(0(100)1000, angle(0) labsize(small) format(%9.0f))   msymbol(o) mcolor(black) msize(small) title("FIGURE G2", size(small)) ciopts(lcolor(black)) subtitle("Marginal Differential Effect of Presidential Loyalty on Median Appointee Tenure" "[Policy Priority Agencies versus Non-Policy Priority Agencies]", size(small)) legend(order(17  18) lab(17 "GA Models Denote Appointees Nominated" "During the First Year of an Administration") lab(18 "GB Models Denote Appointees Not Nominated" "During the First Year of an Administration") rows(2) size(small))

graph save "Graph" "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Graphics\FigureG2.gph", replace




***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


log close

